package com.qk.management.mapper;

import com.qk.entity.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
@SuppressWarnings("all")
public interface DeptMapper {
    @Insert("insert into dept(name,status,create_time,update_time) values(#{name},#{status},#{createTime},#{updateTime})")
    void insert(Dept dept);


    Integer selectCount(String name, Integer status);
    List<Dept> selectByPage(String name, Integer status, Integer offset, Integer pageSize);

    @Select("select * from dept where id=#{id}")
    Dept getById(Integer id);

//    @Update("update dept set name=#{name},status=#{status},update_time=#{updateTime} where id=#{id}")
    Integer updateDept(Dept dept);

    @Delete("delete from dept where id=#{id}")
    Integer deleteById(Integer id);

    @Select("select * from dept")
    List<Dept> getAllDepts();
}
